<template>
  <header>
    <i class="iconfont icon-fanhui" @click="goBack"></i>
    <slot>
      <span>我的地址</span>
    </slot>
    <i class="iconfont icon-kefu"></i>
  </header>
</template>

<script>
export default {
  methods: {
    goBack() {
      if (this.$route.name == 'path-list') {
        this.$router.replace('/path');
      } else {
        this.$router.push('/my');
      }
    }
  }
}
</script>

<style lang='less' scoped>
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  height: 1.2rem;
  color: #fff;
  background-color: #7cda50;
  i {
    padding: 0 0.4rem;
    font-size: 0.586666rem;
  }
  span {
    font-weight: 300;
    font-size: 0.48rem;
  }
}
</style>